package com.hangjiang.gulidear.model;

import java.sql.Timestamp;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.GenericGenerator;

/**
 * Comment entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "comment", catalog = "sqm")
public class Comment extends BaseEntity {

	// Fields

	private String commentId;
	private Project project;
	private User user;
	private String commentTitle;
	private Integer tatalScore;
	private Integer sheduleScore;
	private Integer qualityScore;
	private Integer communicationScore;
	private Date commentTime;
	private String commentContent;

	// Constructors

	/** default constructor */
	public Comment() {
	}

	/** full constructor */
	public Comment(Project project, User user, String commentTitle,
			Integer tatalScore, Integer sheduleScore, Integer qualityScore,
			Integer communicationScore, Date commentTime,
			String commentContent) {
		this.project = project;
		this.user = user;
		this.commentTitle = commentTitle;
		this.tatalScore = tatalScore;
		this.sheduleScore = sheduleScore;
		this.qualityScore = qualityScore;
		this.communicationScore = communicationScore;
		this.commentTime = commentTime;
		this.commentContent = commentContent;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "commentId", unique = true, nullable = false, length = 32)
	public String getCommentId() {
		return this.commentId;
	}

	public void setCommentId(String commentId) {
		this.commentId = commentId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "projId")
	public Project getProject() {
		return this.project;
	}

	public void setProject(Project project) {
		this.project = project;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "userId")
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Column(name = "commentTitle", length = 30)
	public String getCommentTitle() {
		return this.commentTitle;
	}

	public void setCommentTitle(String commentTitle) {
		this.commentTitle = commentTitle;
	}

	@Column(name = "tatalScore")
	public Integer getTatalScore() {
		return this.tatalScore;
	}

	public void setTatalScore(Integer tatalScore) {
		this.tatalScore = tatalScore;
	}

	@Column(name = "sheduleScore")
	public Integer getSheduleScore() {
		return this.sheduleScore;
	}

	public void setSheduleScore(Integer sheduleScore) {
		this.sheduleScore = sheduleScore;
	}

	@Column(name = "qualityScore")
	public Integer getQualityScore() {
		return this.qualityScore;
	}

	public void setQualityScore(Integer qualityScore) {
		this.qualityScore = qualityScore;
	}

	@Column(name = "communicationScore")
	public Integer getCommunicationScore() {
		return this.communicationScore;
	}

	public void setCommunicationScore(Integer communicationScore) {
		this.communicationScore = communicationScore;
	}
    @Temporal(TemporalType.TIMESTAMP)
	@Column(name = "commentTime", length = 0)
	public Date getCommentTime() {
		return this.commentTime;
	}

	public void setCommentTime(Date commentTime) {
		this.commentTime = commentTime;
	}

	@Column(name = "commentContent", length = 200)
	public String getCommentContent() {
		return this.commentContent;
	}

	public void setCommentContent(String commentContent) {
		this.commentContent = commentContent;
	}

}